﻿using System;
using System.Diagnostics.Contracts;

namespace OpenCube.Nbt.Mapping
{
	[ContractClass(typeof(NbtMapperFactoryContract))]
	public interface INbtMapperFactory
	{
		INbtMapper Create<TModel>()
			where TModel : class, new();

		INbtMapper Create(Type modelType);
	}

	[ContractClassFor(typeof(INbtMapperFactory))]
	abstract class NbtMapperFactoryContract
		: INbtMapperFactory
	{
		INbtMapper INbtMapperFactory.Create<TModel>()
		{
			throw new NotImplementedException();
		}

		INbtMapper INbtMapperFactory.Create(Type modelType)
		{
			Contract.Requires<ArgumentNullException>(modelType != null);
			Contract.Ensures(Contract.Result<INbtMapper>() != null);
			throw new NotImplementedException();
		}
	}
}